#define _CRT_SECURE_NO_WARNINGS

#include"process.h"    

typedef void (*callback)(int);
#define TOTAL_SIZE 1024*1024    
#define D_RATE 1024*4    

void download(callback cb)
{
    int sum = 0;
    while (sum <= TOTAL_SIZE)
    {
        int target = TOTAL_SIZE;
        sum += D_RATE;
        int ratio = (sum * 100 / target);
        cb(ratio);
        Sleep(1);
    }

    printf("\n");
}

int main()
{
    download(process);

    return 0;
}
